package framework.formfields;

import java.lang.reflect.Field;

import framework.FormField;

public class FormTextField extends FormField {

	public FormTextField(Field field) throws SecurityException,
			NoSuchFieldException {
		super(field);
	}

	@Override
	public String gerarLinha(Object objeto) throws Exception, Throwable {
		if(isPassword())
		return "<tr> <td>" + getLabel() + "</td>" + "<td><INPUT TYPE=\"PASSWORD\" NAME=\"" + getField().getName() + 
			"\" VALUE=\"" + getField().get(objeto) + "\" MAXLENGHT=\""+ getMaxLenght() +"\"></td> </tr>\n";
		else
		return "<tr> <td>" + getLabel() + "</td>" + "<td><INPUT TYPE=\"TEXT\" NAME=\"" + getField().getName() + 
			"\" VALUE=\"" + getField().get(objeto) + "\" MAXLENGHT=\""+ getMaxLenght() +"\"></td> </tr>\n";
	}
}
